<?php

class My_View_Helper_Test extends Zend_View_Helper_Abstract
{
    protected $negrilla = false;
    protected $txt;

    /**
     *
     * @param string $algo
     * @return My_View_Helper_Test | string
     */
    public function test($algo = null, $options = array())
    {
        if (is_null($algo))
        {
            return $this;
        }
        
        // read and set options
        if (isset($options['negrilla']) && is_bool($options['negrilla']))
        {
            $this->negrilla = $options['negrilla'];
        }
        $this->txt = $algo;
        return $this->toString();
    }

    /**
     * @return string
     */
    public function toString()
    {
        $txt = $this->txt;
        if (true == $this->negrilla) $txt = '<strong>'.$txt.'</strong>';
        $txt = '<p>Esto es un test: '.$txt.'</p>';
        //$this->reset();
        return $txt;
    }

    /**
     * @param boolean $negrilla
     * @return My_View_Helper_Test
     */
    public function setNegrilla($negrilla = true)
    {
        $this->negrilla = $negrilla;
        return $this;
    }

    /**
     * @return My_View_Helper_Test
     */
    public function reset()
    {
        $this->negrilla = false;
        $this->txt = null;
        return $this;
    }
}
